//
//  FTYMenuViewController.h
//  ChinaNews
//
//  Created by Liufangfang on 2016/11/22.
//  Copyright © 2016年 Liufangfang. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, FTYSegmentStyle) {

    FTYSegmentStyleDefault,     /**< 指示杆和按钮的标题齐平*/
    FTYSegmentStyleFlush,       /**< 指示杆和按钮宽度齐平*/
};

@interface FTYMenuViewController : UIViewController

@property (nonatomic, strong) UIColor *segmentTintColor;        /**< 选中时的字体颜色，默认黑色*/
@property (nonatomic, strong) NSArray *viewControllers;
@property (nonatomic, strong) UIScrollView *segmentView;
@property (nonatomic, assign) FTYSegmentStyle style;

+ (instancetype)segmentControllerWithFrame:(CGRect)frame titles:(NSArray<NSString *>*)titles;
- (instancetype)initWithFrame:(CGRect)frame titles:(NSArray *)titles;


/**
 跟新controller数据

 @param viewControllers controller数组
 */
- (void)setSegmentViewControllers:(NSArray <UIViewController *>*)viewControllers;

//返回当前被选中的item的下标
- (NSInteger)selectedAtIndex;
- (void)selectedAtIndex:(void(^)(NSInteger index))indexBlock;

//手动指定选中的item
- (void)setDefaultSelectItemAtIndex:(NSInteger)index;

/**
 更新SegmentView文字显示
 */
- (void)updateSegmentView:(NSArray *)array;

@end
